<% if session[:cart] %>
<div id="dat">
    <table id="table" class="tablesorter" border="0" cellpadding="0" cellspacing="1">
      <thead>
        <tr>
          <th>
            Name
          </th>
          <th>
            Description
          </th>
          <th>
            Out Date
          </th>
          <th>
            Return Date
          </th>
          <th>
            Remove
          </th>
        </tr>
      </thead>
      <tbody>
      <% for equipment in session[:cart] %>
        <tr>
          <td>
	          <%= h(equipment.name) %>
	        </td><td>
	          <%= truncate(h(equipment.description),20) %>
	        </td><td>
	          <input type="text" value="<%= Date.today %>"
            onfocus="this.select();calendar_open(this,{format:'%Y-%m-%d'})"
            onclick="event.cancelBubble=true;this.select();calendar_open(this,{format:'%Y-%m-%d'})" />
	        </td><td>
	          <input type="text" value="<%= Date.today %>"
            onfocus="this.select();calendar_open(this,{format:'%Y-%m-%d'})"
            onclick="event.cancelBubble=true;this.select();calendar_open(this,{format:'%Y-%m-%d'})" />
	        </td><td>
	          <%= link_to "[Delete]", {:action => "remove_from_cart", :id => equipment.id}, {:method => :post, :confirm => "Confirm removal of #{equipment.name}"} %>
          </td>
        </tr>
      <% end %>
      </tbody>
    </table>
</div>
    <input type="submit" id="remember" value="Submit">
<% end %>

<script type="text/javascript">
    $("#remember").click(function() {
      //$('#')
      $('#date_dialog').dialog('close');
    });
</script>

